<layout name="layout" />

<!-- CustomerEditForm.js中用到了WarehouseField.js -->
<script src="__CDN__/Scripts/PSI/Warehouse/WarehouseField.js?dt={$Think.config.site.version}" type="text/javascript"></script>

<script src="__CDN__/Scripts/PSI/User/UserField.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/User/OrgWithDataOrgField.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/Goods/GoodsWithSalePriceField.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/Goods/GoodsEditForm.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/Goods/GoodsCategoryField.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/Goods/GoodsBrandField.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/Goods/GoodsField.js?dt={$Think.config.site.version}" type="text/javascript"></script>

<script src="__CDN__/Scripts/PSI/Customer/CustomerField.js?dt={$Think.config.site.version}" type="text/javascript"></script>

<script src="__CDN__/Scripts/PSI/SaleOrder/SOMainForm.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<!-- GoodsPrice会mix到SOEditForm，所以需要放在其前面引用 -->
<script src="__CDN__/Scripts/PSI/Mix/GoodsPrice.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/SaleOrder/SOEditForm.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/SaleOrder/ChangeOrderEditForm.js?dt={$Think.config.site.version}" type="text/javascript"></script>

<script src="__CDN__/Scripts/PSI/Sale/WSEditForm.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/Sale/WSExportForm.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/Sale/WSImportForm.js?dt={$Think.config.site.version}" type="text/javascript"></script>

<script src="__CDN__/Scripts/PSI/Customer/CustomerEditForm.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/UX/CellEditing.js?dt={$Think.config.site.version}" type="text/javascript"></script>

<script src="__CDN__/Lodop/LodopFuncs.js?dt={$Think.config.site.version}" type="text/javascript"></script>

<!-- 生成采购订单 -->
<script src="__CDN__/Scripts/PSI/PurchaseOrder/POEditForm.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/Supplier/SupplierField.js?dt={$Think.config.site.version}" type="text/javascript"></script>
<script src="__CDN__/Scripts/PSI/Goods/GoodsWithPurchasePriceField.js?dt={$Think.config.site.version}"
  type="text/javascript"></script>

<script>
  Ext.onReady(function () {
    var app = Ext.create("PSI.App", {
      userName: "{$admin.username}",
      productionName: "{$site.name|mb_substr=0,4,'utf-8'|mb_strtoupper='utf-8'}"
    });

    var permission = {
      add: "{$pAdd}",
      edit: "{$pEdit}",
      del: "{$pDelete}",
      genPDF: "{$pGenPDF}",
      confirm: "{$pConfirm}",
      genWSBill: "{$pGenWSBill}",
      genPOBill: "{$pGenPOBill}",
      print: "{$pPrint}",
      showAddGoodsButton: "{$showAddGoodsButton}",
      closeBill: "{$pCloseBill}"
    };

    app.add(Ext.create("PSI.SaleOrder.SOMainForm", {
      permission: permission
    }));
    app.setAppHeader({
      title: "{$title}",
      iconCls: "PSI-fid2028"
    });
  });
</script>
